<?php

namespace App\Http\Controllers\Agency;

use App\Http\Controllers\Controller;
use App\Services\ExamineService;
use Illuminate\Http\Request;
use hg\apidoc\annotation as Apidoc;
/**
 * 用户审核
 * @Apidoc\Group("examine")
 */
class ExamineController extends Controller
{
    /**
     * @Apidoc\Title ("用户审核-基础数据")
     * @Apidoc\Url("/agency/baseInfo")
     * @Apidoc\Method("GET")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Returned("dataNum",type="int",desc="资料待审核数量")
     * @Apidoc\Returned("avatarNum",type="int",desc="头像待审核数量")
     * @Apidoc\Returned("photoNum",type="int",desc="相册待审核数量")
     * @Apidoc\Returned("introNum",type="int",desc="自我介绍待审核数量")
     *
     */
    public function baseInfo(Request $request , ExamineService $examineService)
    {
        $params['aid'] = $this->getAid();
        $result = $examineService->baseInfo($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("资料审核")
     * @Apidoc\Url("/agency/checkData")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("page",type="int",require=true,desc="页数")
     * @Apidoc\RouteParam("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\RouteParam("id",type="int",require=false,desc="用户id")
     * @Apidoc\RouteParam("username",type="string",require=false,desc="用户昵称")
     * @Apidoc\RouteParam("mobile",type="string",require=false,desc="用户手机号")
     * @Apidoc\RouteParam("status",type="string",require=false,desc="用户资料状态wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Returned("id",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("sn",type="string",require=false,desc="用户编号"),
     * @Apidoc\Returned("username",type="string",require=false,desc="用户昵称"),
     * @Apidoc\Returned("realname",type="string",require=false,desc="用户姓名"),
     * @Apidoc\Returned("age",type="int",require=false,desc="用户年龄"),
     * @Apidoc\Returned("height",type="int",require=false,desc="用户身高"),
     * @Apidoc\Returned("avatar",type="string",require=false,desc="用户头像"),
     * @Apidoc\Returned("gender",type="int",require=false,desc="用户性别1：男；2：女；3：未知"),
     * @Apidoc\Returned("birthday",type="string",require=false,desc="用户生日"),
     * @Apidoc\Returned("national",type="int",require=false,desc="用户民族"),
     * @Apidoc\Returned("marry",type="int",require=false,desc="用户婚况"),
     * @Apidoc\Returned("education",type="int",require=false,desc="用户学历"),
     * @Apidoc\Returned("job",type="int",require=false,desc="用户工作"),
     * @Apidoc\Returned("salary",type="int",require=false,desc="用户年收入"),
     * @Apidoc\Returned("mobile",type="string",require=false,desc="用户手机号"),
     * @Apidoc\Returned("belongprovince",type="string",require=false,desc="用户手机号归属地省"),
     * @Apidoc\Returned("belongcity",type="string",require=false,desc="用户手机号归属地市"),
     * @Apidoc\Returned("weixin",type="string",require=false,desc="用户微信"),
     * @Apidoc\Returned("province",type="int",require=false,desc="用户现居省code"),
     * @Apidoc\Returned("province_name",type="string",require=false,desc="用户现居省"),
     * @Apidoc\Returned("city",type="int",require=false,desc="用户现居市code"),
     * @Apidoc\Returned("city_name",type="string",require=false,desc="用户现居市"),
     * @Apidoc\Returned("area",type="int",require=false,desc="用户现居区code"),
     * @Apidoc\Returned("area_name",type="string",require=false,desc="用户现居区"),
     * @Apidoc\Returned("reside_province",type="int",require=false,desc="用户户籍省code"),
     * @Apidoc\Returned("reside_province_name",type="string",require=false,desc="用户户籍省"),
     * @Apidoc\Returned("reside_city",type="int",require=false,desc="用户户籍市code"),
     * @Apidoc\Returned("reside_city_name",type="string",require=false,desc="用户户籍市"),
     * @Apidoc\Returned("reside_area",type="int",require=false,desc="用户户籍区code"),
     * @Apidoc\Returned("reside_area_name",type="string",require=false,desc="用户户籍区"),
     * @Apidoc\Returned("sibling",type="int",require=false,desc="用户兄弟姐妹"),
     * @Apidoc\Returned("smoking",type="int",require=false,desc="用户吸烟情况"),
     * @Apidoc\Returned("drinking",type="int",require=false,desc="用户喝酒情况"),
     * @Apidoc\Returned("created_at",type="string",require=false,desc="用户注册时间"),
     * @Apidoc\Returned("status",type="string",require=false,desc="用户状态"),
     * @Apidoc\Returned("ispay",type="int",require=false,desc="审核费用Y已付费；N未付费"),
     * @Apidoc\Returned("interest",type="array",require=false,desc="用户兴趣爱好"),
     * @Apidoc\Returned("personality",type="array",require=false,desc="用户性格"),
     * @Apidoc\Returned("genderText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("marryText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("educationText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("jobText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("salaryText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("houseText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("carText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("typeText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("intentionText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("statusText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("belongText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("tgText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("makerText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("ispayText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("companytypeText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("drinkingText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("smokingText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("nationalText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("childText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("interestText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("personalityText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("siblingText",type="int",require=false,desc="字段注释"),
     *
     */
    public function checkData(Request $request , ExamineService $examineService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $examineService->checkData($params);
        return $this->responseSuccess($result);
    }
    /**
     * @Apidoc\Title ("资料审核-更新状态")
     * @Apidoc\Url("/agency/dataStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("ids",type="int",require=true,desc="列表id 1,2,4")
     * @Apidoc\RouteParam("status",type="string",require=true,desc="wait待审核；pass通过；refuse未通过")
     * @Apidoc\RouteParam("reason",type="string",require=false,desc="驳回理由")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function dataStatusUpdate(Request $request ,ExamineService $examineService)
    {
        $params = $request->input();
        $result = $examineService->dataStatusUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("头像审核")
     * @Apidoc\Url("/agency/checkAvatar")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("page",type="int",require=true,desc="页数")
     * @Apidoc\RouteParam("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\RouteParam("id",type="int",require=false,desc="用户id")
     * @Apidoc\RouteParam("username",type="string",require=false,desc="用户昵称")
     * @Apidoc\RouteParam("mobile",type="string",require=false,desc="用户手机号")
     * @Apidoc\RouteParam("aflag",type="string",require=false,desc="用户头像状态wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Returned("id",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("mid",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("sn",type="string",require=false,desc="用户编号"),
     * @Apidoc\Returned("username",type="string",require=false,desc="用户昵称"),
     * @Apidoc\Returned("gender",type="string",require=false,desc="用户性别"),
     * @Apidoc\Returned("genderText",type="int",require=false,desc="用户性别注释"),
     * @Apidoc\Returned("mobile",type="int",require=false,desc="用户手机号"),
     * @Apidoc\Returned("avatar",type="string",require=false,desc="用户头像"),
     * @Apidoc\Returned("aflag",type="int",require=false,desc="用户头像状态"),
     * @Apidoc\Returned("aflagText",type="string",require=false,desc="用户头像状态注释"),
     **/
    public function checkAvatar(Request $request , ExamineService $examineService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $examineService->checkAvatar($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("资料审核-更新头像状态")
     * @Apidoc\Url("/agency/avatarStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("ids",type="int",require=true,desc="列表id 1,2,4")
     * @Apidoc\RouteParam("aflag",type="string",require=true,desc="wait待审核；pass通过；refuse未通过")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function avatarStatusUpdate(Request $request ,ExamineService $examineService)
    {
        $params = $request->input();
        $result = $examineService->avatarStatusUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("相册审核")
     * @Apidoc\Url("/agency/checkPhoto")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("page",type="int",require=true,desc="页数")
     * @Apidoc\RouteParam("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\RouteParam("id",type="int",require=false,desc="用户id")
     * @Apidoc\RouteParam("username",type="string",require=false,desc="用户昵称")
     * @Apidoc\RouteParam("mobile",type="string",require=false,desc="用户手机号")
     * @Apidoc\RouteParam("status",type="string",require=false,desc="用户头像状态wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Returned("id",type="int",require=false,desc="id"),
     * @Apidoc\Returned("mid",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("sn",type="string",require=false,desc="用户编号"),
     * @Apidoc\Returned("age",type="string",require=false,desc="用户年龄"),
     * @Apidoc\Returned("username",type="string",require=false,desc="用户昵称"),
     * @Apidoc\Returned("gender",type="string",require=false,desc="用户性别"),
     * @Apidoc\Returned("genderText",type="int",require=false,desc="用户性别注释"),
     * @Apidoc\Returned("created_at",type="int",require=false,desc="添加时间"),
     * @Apidoc\Returned("url",type="string",require=false,desc="用户相册url"),
     * @Apidoc\Returned("status",type="int",require=false,desc="用户相册状态"),
     * @Apidoc\Returned("statusText",type="string",require=false,desc="用户相册状态注释"),
     **/
    public function checkPhoto(Request $request , ExamineService $examineService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $examineService->checkPhoto($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("资料审核-更新相册状态")
     * @Apidoc\Url("/agency/photoStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("ids",type="int",require=true,desc="列表id 1,2,4")
     * @Apidoc\RouteParam("status",type="string",require=true,desc="wait待审核；pass通过；refuse未通过")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function photoStatusUpdate(Request $request ,ExamineService $examineService)
    {
        $params = $request->input();
        $result = $examineService->photoStatusUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("自我介绍审核")
     * @Apidoc\Url("/agency/checkIntro")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\RouteParam("page",type="int",require=true,desc="页数")
     * @Apidoc\RouteParam("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\RouteParam("id",type="int",require=false,desc="用户id")
     * @Apidoc\RouteParam("username",type="string",require=false,desc="用户昵称")
     * @Apidoc\RouteParam("mobile",type="string",require=false,desc="用户手机号")
     * @Apidoc\RouteParam("iflag",type="string",require=false,desc="用户自我介绍状态wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Returned("id",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("mid",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("sn",type="string",require=false,desc="用户编号"),
     * @Apidoc\Returned("username",type="string",require=false,desc="用户昵称"),
     * @Apidoc\Returned("gender",type="string",require=false,desc="用户性别"),
     * @Apidoc\Returned("genderText",type="int",require=false,desc="用户性别注释"),
     * @Apidoc\Returned("mobile",type="int",require=false,desc="用户手机号"),
     * @Apidoc\Returned("intro",type="string",require=false,desc="用户自我介绍"),
     * @Apidoc\Returned("iflag",type="int",require=false,desc="用户自我介绍状态"),
     * @Apidoc\Returned("iflagText",type="string",require=false,desc="用户自我介绍状态注释"),
     **/
    public function checkIntro(Request $request , ExamineService $examineService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $examineService->checkIntro($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("资料审核-更新自我介绍状态")
     * @Apidoc\Url("/agency/infoStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("ids",type="int",require=true,desc="列表id 1,2,4")
     * @Apidoc\Param("iflag",type="string",require=true,desc="wait待审核；pass通过；refuse未通过")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function infoStatusUpdate(Request $request ,ExamineService $examineService)
    {
        $params = $request->input();
        $result = $examineService->infoStatusUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }
}
